package com.zqw.service.impl;

import com.zqw.info.UserInfo;
import com.zqw.mapper.UserMapper;
import com.zqw.pojo.UserPojo;
import com.zqw.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    //登录
    @Override
    public UserInfo login(UserPojo user) {
        UserInfo login = userMapper.login(user);
        return login;
    }

    /**
     * 	注册
     * @param user
     * @return
     */
    public boolean regist(UserInfo user){
        return userMapper.regist(user);
    }

    /**
     * 	用户名唯一校验
     * @param caccount
     * @return
     */
    public Boolean soleName(String caccount){
        return userMapper.soleName(caccount);
    }

    /**
     * 查询会员
     * @param userInfo
     * @return
     */
    public List<UserPojo> queryCustomer(UserInfo userInfo){
        return userMapper.queryCustomer(userInfo);
    }

    /**
     * 修改会员
     * @param userInfo
     * @return
     */
    public boolean updCustomer(UserInfo userInfo){
        return userMapper.updCustomer(userInfo);
    }

    /**
     * 删除会员
     * @param cids
     * @return
     */
    public boolean delCustomer(String[] cids){
        return userMapper.delCustomer(cids);
    }

    /**
     * 更改会员状态
     * @param userInfo
     * @return
     */
    public boolean updCustomerStatus(UserInfo userInfo){
        return userMapper.updCustomerStatus(userInfo);
    }

    /**
     * 修改密码
     * @param userInfo
     * @return
     */
    public boolean updPass(UserInfo userInfo){
        return userMapper.updPass(userInfo);
    }

}
